// 基于template/src/widgets/{{appEntities}}/{{ctrls@TREEVIEW}}-tree/{{spinalCase ctrl.codeName}}-tree-model.ts.hbs生成
import { ITreeModel, ITreeNodeModel, ITreeNodeRsModel } from "@/core";

function getModel(): ITreeModel {
    return {
        name: "tree",
        caption: "",
        codeName: "TreeMajorState",
        cssName: "",
        controlType: "TREEVIEW",
        entityCodeName: "IBIZBOOK",
        ctrlMsgModel:[
    ],
        rootVisible: false,
        treeNodes: getTreeNodes(),
        treeNodeRSs: getTreeNodeRSs(),
    }
}

function getTreeNodes(): ITreeNodeModel[] {
    return [
            {
                id: "ROOT",
                treeNodeType: "STATIC",
                allowDrag: false,
                allowDrop: false,
                allowEditText: false,
                allowOrder: false,
                enableCheck: false,
                disableSelect: false,
                expanded: false,
                cssName: "",
                leaf: false,
                selected: false,
                navFilter: "",
                appendPNodeId: false,
                counterId: "",
                counterMode: 0,
                nodeType: "ROOT",
                rootNode: true,
                selectFirstOnly: false,
                expandFirstOnly: false,
                enableQuickSearch: false,
                text: "默认根节点",
                tooltip: "",
                nodeValue: "root",
                navigateContext: {  },
                navigateParams: {  },
            },
            {
                id: "book",
                treeNodeType: "STATIC",
                allowDrag: false,
                allowDrop: false,
                allowEditText: false,
                allowOrder: false,
                enableCheck: false,
                disableSelect: false,
                expanded: false,
                cssName: "",
                leaf: false,
                selected: false,
                navFilter: "",
                appendPNodeId: false,
                counterId: "",
                counterMode: 0,
                nodeType: "book",
                rootNode: false,
                selectFirstOnly: false,
                expandFirstOnly: false,
                enableQuickSearch: false,
                text: "图书",
                tooltip: "",
                nodeValue: "",
                navigateContext: {  },
                navigateParams: {  },
            },
            {
                id: "bookdata",
                treeNodeType: "DE",
                allowDrag: false,
                allowDrop: false,
                allowEditText: false,
                allowOrder: false,
                enableCheck: false,
                disableSelect: false,
                expanded: false,
                cssName: "",
                leaf: true,
                selected: false,
                navFilter: "",
                appendPNodeId: false,
                counterId: "",
                counterMode: 0,
                nodeType: "bookdata",
                rootNode: false,
                selectFirstOnly: false,
                expandFirstOnly: false,
                enableQuickSearch: false,
                entityCodeName: "IBIZBOOK",
                controlVoName: "BookdataControlVO",
                keyPSAppDEField: "IBIZBOOKId",
                majorPSAppDEField: "IBIZBOOKName",
                appDeDataSet: "FetchDefault",
                navigateContext: {  },
                navigateParams: {  },
                contextMenus: [
                        {
                            name: "deuiaction1",
                            ctrlname: "bookdata_cm",
                            nodeOwner: "bookdata",
                            caption: "编辑",
                            showCaption: true,
                            showIcon: true,
                            tooltip: "编辑",
                            uiAction: {
                                actionTag: "Edit",	
                                actionTarget: "SINGLEKEY",
                                dataAccessAction: "EDIT",
                                noPrivDisplayMode: 1,
                                visible: true,
                                disabled: false,            
                                uIActionMode: "FRONT",
                                uIActionType: "DEUIACTION",
                                actionDECodeName: "IBIZBOOK",
                                predefinedType: "",            
                            },        
                            cssClass: "fa fa-edit",
                        },
                        {
                            name: "deuiaction2",
                            ctrlname: "bookdata_cm",
                            nodeOwner: "bookdata",
                            caption: "删除",
                            showCaption: true,
                            showIcon: true,
                            tooltip: "删除",
                            uiAction: {
                                actionTag: "Delete",	
                                actionTarget: "SINGLEKEY",
                                dataAccessAction: "DELETE",
                                noPrivDisplayMode: 1,
                                visible: true,
                                disabled: false,            
                                uIActionMode: "BACKEND",
                                uIActionType: "DEUIACTION",
                                actionDECodeName: "IBIZBOOK",
                                predefinedType: "",            
                            },        
                            cssClass: "fa fa-remove",
                        },
                        {
                            name: "deuiaction3",
                            ctrlname: "bookdata_cm",
                            nodeOwner: "bookdata",
                            caption: "打开文档",
                            showCaption: true,
                            showIcon: true,
                            tooltip: "打开文档",
                            uiAction: {
                                actionTag: "openDocument",	
                                actionTarget: "SINGLEKEY",
                                dataAccessAction: "OPEN_DOCUMENT",
                                noPrivDisplayMode: 1,
                                visible: true,
                                disabled: false,            
                                uIActionMode: "FRONT",
                                uIActionType: "DEUIACTION",
                                actionDECodeName: "IBIZBOOK",
                                predefinedType: "",            
                            },        
                        }
                ],
            }
    ]
}

function getTreeNodeRSs(): ITreeNodeRsModel[] {
    return [
            {
                childDeTreeNodeId: "book",
                parentPSDETreeNodeId: "ROOT",
                parentValueLevel: 1,
                searchMode: 3,
                navigateContext: {  },
                navigateParams: {  },
            },
            {
                childDeTreeNodeId: "bookdata",
                parentPSDETreeNodeId: "book",
                parentValueLevel: 1,
                searchMode: 3,
                navigateContext: {  },
                navigateParams: {  },
            }
    ]
}
export const model = getModel();
